package dao.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class UserDaoProxy implements InvocationHandler {
    private Object obj;
    public UserDaoProxy(Object obj){
        this.obj=obj;
    }
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println(method.getName()+"方法执行前");
        Object res = method.invoke(obj,args);
        System.out.println("方法执行后");
        return res;
    }
}
